package com.hunter.service;

import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.ContextRefreshedEvent;

/**
 * Created by Administrator on 2017/6/23.
 */
@Configuration
public class ApplicationStartup implements ApplicationListener<ContextRefreshedEvent> {
    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
//        //创建对象，开始线程
        RXTXService rxtxServicex=new RXTXService();
        rxtxServicex.openSerialPort();

    }
}